define(function(require, exports, module) {

	var $ = require("jquery1.7");

    var uploadify = require("uploadify");
	var utils = require("utils");
	var ctx = utils.constants.ctx;
	
	$('#file_upload').uploadify({
	        'swf'      : ctx+'/static-res/sea-modules/1.0/uploadify/uploadify.swf',
	        'uploader' : ctx+'/pb-upload-json',
	        'buttonText':"上传文件",
	        'onUploadSuccess' : function(file, data, response) {
	        	       var json = eval("("+data+")");
	        	       $.each(json,function(i,d){
	        	    	   console.log(d.fileName);
	        	       });
	        	    }
	        // Put your options here
	    });
	$('.uploadify_file').live("click",function(){
		console.log("enter ...");
		$('#file_upload').uploadify('upload');
	});
	
	$('.uploadify-cancel').live("click",function(){
		var _this = $(this);
		var obj = _this.attr("idate");
		$('#file_upload').uploadify('cancel', obj);
	});
	
});